{% load pp_url %}
{% load topictags %}
{% load issuetags %}
{% load consensustags %}
{% load argumenttags %}
{% load solutiontags %}
{% load sourcetags %}
{% load tag_helpers %}
{% load filetransfers %}


<div class="sourcetags">
   <div class="sources">

<b>Sources:</b> 
{% ifequal request.user request.object.user %}<a href="javascript:;" onmousedown="toggleSlide('mydiv');">+url</a> 


{% comment %}
<a href="javascript:;" onmousedown="toggleSlide('mydiv2');">+image</a>

<div id="mydiv2"  style="display:none; overflow:hidden; height:250px;">
{% pp_imgsource_form POST=request.POST object=request.object user=request.user FILE=request.FILES request=request %}
<form action="{{ pp_source.upload_url }}" method="POST" enctype="multipart/form-data">
 {{ pp_source.form.errors }}
  {% render_upload_data pp_source.upload_data %}
	                    <form method="post" action="">
		                    {{ pp_source.imgform.as_p }}
	                      	{{ pp_source.imgform.form_id}}
		                    {% csrf_token %}
                          <input type="submit" class="button green" value="Submit IMG">
	                    </form>
  {% endpp_imgsource_form %}

</div>

{% endcomment %}

{% endifequal %}
        
        {% pp_get_sources object=request.object %}
            <ul>                       
            {% for imgsource in pp_source.imgsource_list %}
                  <li><img src="/upload_images/{{imgsource.img}}"></li>
            {% endfor %}
            </ul>

            <ul>                       
            {% for urlsource in pp_source.urlsource_list %}
              <li>
                {% ifequal request.user request.object.user %}
                    <a href="{{urlsource.url}}">{{urlsource.url}}</a> <a href="/sourcedelete/{{urlsource.id}}/" class="small button red">-</a>
                {% else %}
                    <a href="{{urlsource.url}}">{{urlsource.url}}</a> 
                {% endifequal %}                            
            </li>
            {% endfor %}
        {% endpp_get_sources %}
            </ul>

    {% ifequal request.user request.object.user %}

                <div id="mydiv" style="display:none; overflow:hidden; height:30px;">

                         {% pp_urlsource_form POST=request.POST object=request.object user=request.user %}
                       {{ pp_source.form.errors }}
	                    <form method="post" action="">
		                    {{ pp_source.urlform.url}}
	                      	{{ pp_source.urlform.form_id}}
		                    {% csrf_token %}
                          <input type="submit" class="button green" value="Submit URL">
	                    </form>
                   {% endpp_urlsource_form %}
               </div>

    {% endifequal %}



</div>
    {% if request.object.taggable %}
<div class="taglist">
<b>Tags:</b>{% if request.user.is_authenticated and request.object %}<a href="javascript:;" onmousedown="toggleSlide('tag_rightcol');">+tag</a>{% endif %}
    <ul class="d">
            <div id="ajax_tag_list">
               {% pp_get_link_tags_for_object object=request.object %}
			            {{pp_tag.tags|safe}}
                {% endpp_get_link_tags_for_object %}
             <div>
    {% endif %}

    </ul>    

    {% if request.user.is_authenticated and request.object.taggable %}
                    
        {% pp_tag_form POST=request.POST path=request.path object=request.object user=request.user %}
            <div id="tag_rightcol" style="display:none; overflow:hidden; height:150px;">
               {{ pp_tag.form.errors }}
                <form method="post" action="">
                    {{ pp_tag.form.tag}}
                    {{pp_tag.form.form_id}}
                    {% csrf_token %}
                <input type="submit" class='button green' value="Submit Tag">
                </form>
        {% endpp_tag_form %}

               <div id="ajax_link_tag_list">
                {% pp_tag_recommendations object=request.object %}
        
                      {{pp_tag.taglist|safe}}

                {% endpp_tag_recommendations %} 
            </div>
            </div>
    {% endif %}  

</div>
</div>
</div>


           
                
